// @FileName  :area.c
// @Time      :2024/2/29 19:53
// @Author    :YKW
//# include <bits/stdc++.h>
//using namespace std;
#include<stdio.h>

#define ll long long

int min(ll int a, ll int b) {
    if (a > b) return b;
    else return a;
}

int max(ll int a, ll int b) {
    if (a > b) return a;
    else return b;
}

struct xy {
    ll int x;
    ll int y;
};

void main() {
    struct xy z[4];
    int sum = 0;
    for (int i = 0; i < 4; i++) {
        scanf("%lld %lld", &z[i].x, &z[i].y);
    }
    int minax=min(z[0].x, z[1].x);
    int maxax=max(z[0].x, z[1].x);
    int minbx=min(z[2].x, z[3].x);
    int maxbx=max(z[2].x, z[3].x);
    int minay=min(z[0].y, z[1].y);
    int maxay=max(z[0].y, z[1].y);
    int minby=min(z[2].y, z[3].y);
    int maxby=max(z[2].y, z[3].y);
    int xj=min(maxax,maxbx)-max(minax,minbx);
    int yj=min(maxay,maxby)-max(minay,minby);
    sum=xj*yj;
    printf("%d", (xj>0&&yj>0) ? sum : 0);
    return 0;
}